package 
{
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.external.ExternalInterface;
	/**
	 * ...
	 * @author Omar Contreras
	 */
	public class Main extends Sprite 
	{
		
		private var main_mc:MovieClip;
		private var button_cont_mc:MovieClip;
		
		
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			
			main_mc = mainContainer;
			button_cont_mc = mainContainer.buttons_container_mc;
			ExternalInterface.addCallback("TweenIn", TweenIn);
			ExternalInterface.addCallback("TweenOut", TweenOut);
			ExternalInterface.addCallback("highLightVoiceIcon", highLightVoiceIcon);
			ExternalInterface.addCallback("setIncommingCommand", setIncommingCommand);
		}
		
		public function TweenIn(choice_name:String):void 
		{
			button_cont_mc.TweenOptionIn(choice_name);
		}
		
		public function TweenOut():void 
		{
			button_cont_mc.TweenActiveOptionOut();
		}
		
		public function highLightVoiceIcon(setHigh:Number = 0):void 
		{
			if(Boolean(setHigh))
				main_mc.HighlightSpeakIcon();
			else	
				main_mc.LowlightSpeakIcon();
		}
		
		public function setIncommingCommand(command:String):void
		{
			main_mc.setCommandIntoBox(command);
		}
		
	}
	
}